- /* scfcsinh.cpp by K.Tsuru */
- // function ID = 9110
- /*****************************************
- SComplex class
- It returns sinh(z).
- Let z = x+iy,
- sinh(z) = sinh(x)*cos(y)+i*cosh(x)*sin(y).
- *****************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- #define UseCSBScsinh 0
-
- SComplex Csinh(const SComplex& z)
- {
- #if UseCSBScsinh // 16.09 sec
- SDouble chx, shx, cy, sy, x(Re(z)), y(Im(z));
-
- Hyperbolic(x, chx, shx); // chx = cosh(x) shx = sinh(x)
- CosSinBS(y, cy, sy); // cy = cos(y), sy = sin(y);
-
- return SComplex(shx*cy, chx*sy);
- #else // 16.15 sec
- SDouble rr, ri, sh, s, c;
- sh = Sinh(z.Real());
- s = Sin(z.Imag());
-
- if( (s.PreferSpeed() == ON) && (s.NetRdxExp() > -2) ){
- c = Sqrt(1.0-s*s); // |s| is O(1.0).
- }else c = Cos(z.Imag()); // |s| is very small.
-
- rr = sh*c; // sinh(x)*cos(y)
- ri = Sqrt(1.0+sh*sh)*s; // cosh(x)*sin(y)
- return SComplex(rr, ri);
- #endif
- }
scfcsinh.cpp : last modifiled at 2015/08/17 11:34:56(942 bytes)
created at 2017/10/06 15:21:28
The creation time of this html file is 2017/10/06 15:27:09 (Fri Oct 06 15:27:09 2017).